POV-Ray : Newsgroups : povray.general : Passing file handles to macros : Re: Passing file handles to macros Server Time
19 Nov 2024 01:43:28 EST (-0500)
  Re: Passing file handles to macros  
From: Slime
Date: 26 May 2002 15:42:38
Message: <3cf13aae$1@news.povray.org>
> > Did this in effect mean that you couldn't open a filehandle outside a
> macro
> > and then write to the filehandle inside the macro?
>
> Yes.


Well... I may be mistaken, but I believe this works:

#macro dostuff()
#write(MYFILE, "hi")
#end

#fopen MYFILE "myfile.txt" write
dostuff()
#fclose MYFILE

You just can't pass the actual file handle to the macro, so you have to be
able to pre-write the macro knowing what the filehandle will be named. A
significant restriction, yes. Not horrible though.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.